package com.mapper;

import com.entity.AddressList;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

public interface AddressListMapper {

    //查询所有数据
    @Select("select * from addresslist")
    public List<AddressList> findAll();
    //增加数据
    @Insert("insert into addresslist values(null,#{a_name},#{a_phone},#{a_mail},#{a_relation})")
    public void insert(@Param("a_name") String A_Name,
                       @Param("a_phone") String A_Phone,
                       @Param("a_mail") String A_Mail,
                       @Param("a_relation") String A_Relation);
    @Delete("delete from addresslist where a_id = #{a_id}")
    public void delete(int a_id);
}
